This repository has been archived by the owner on Oct 14, 2023. It is now read-only.
/
Analyzing NEOs.mystnb
77 lines (58 loc) · 2.21 KB
/
Analyzing NEOs.mystnb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
jupytext:
encoding: '# -*- coding: utf-8 -*-'
text_representation:
extension: .mystnb
format_name: myst
format_version: 0.13
jupytext_version: 1.14.0
kernelspec:
display_name: Python 3
language: python
name: python3
---
# Analyzing NEOs
+++
NEO stands for near-Earth object. The Center for NEO Studies ([CNEOS](http://cneos.jpl.nasa.gov/)) defines NEOs as comets and asteroids that have been nudged by the gravitational attraction of nearby planets into orbits that allow them to enter the Earth’s neighborhood.
And what does "near" exactly mean? In terms of orbital elements, asteroids and comets can be considered NEOs if their perihelion (orbit point which is nearest to the Sun) is less than 1.3 au = 1.945 * 10<sup>8</sup> km from the Sun.
```{code-cell}
from astropy import time
from poliastro.bodies import Earth
from poliastro.frames import Planes
from poliastro.plotting import StaticOrbitPlotter
from poliastro.twobody.orbit import Orbit
```
## Small Body Database (SBDB)
```{code-cell}
eros = Orbit.from_sbdb("Eros")
eros.plot(label="Eros")
```
You can also search by IAU number or SPK-ID (there is a faster `neows.orbit_from_spk_id()` function in that case, although):
```{code-cell}
:tags: [nbsphinx-thumbnail]
ganymed = Orbit.from_sbdb("1036") # Ganymed IAU number
amor = Orbit.from_sbdb("2001221") # Amor SPK-ID
eros = Orbit.from_sbdb("2000433") # Eros SPK-ID
frame = StaticOrbitPlotter(plane=Planes.EARTH_ECLIPTIC)
frame.plot(ganymed, label="Ganymed")
frame.plot(amor, label="Amor")
frame.plot(eros, label="Eros")
```
You can use the wildcards from that browser: `*` and `?`.
+++
<div class="alert alert-info">Keep it in mind that `from_sbdb()` can only return one Orbit, so if several objects are found with that name, it will raise an error with the different bodies:</div>
```{code-cell}
try:
Orbit.from_sbdb("*alley")
except ValueError as err:
print(err)
```
<div class="alert alert-info">Note that the epoch is provided by the service itself, so if you need orbit on another epoch, you have to propagate it:</div>
```{code-cell}
eros.epoch.iso
```
```{code-cell}
epoch = time.Time(2458000.0, scale="tdb", format="jd")
eros_november = eros.propagate(epoch)
eros_november.epoch.iso
```